import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:largefriends/res/lf_color.dart';
import 'package:largefriends/res/lf_double_ext.dart';
import 'package:largefriends/widgets/custom_cache_image.dart';

import '../../../entity/entities/chat_new_message_entity.dart';
import '../../../res/lf_fonts.dart';
import '../../../res/lf_text_style.dart';
import '../../../res/strings/lf_strings.dart';
import '../../../service/lf_auth_service.dart';

class LfMessageMatch extends StatelessWidget {
  const LfMessageMatch({Key? key, required this.data, required this.avatar})
      : super(key: key);
  final ChatNewMessageEntity data;
  final String avatar;
  @override
  Widget build(BuildContext context) {
    LfAuthService authService = Get.find();
    return SizedBox(
      width: ScreenUtil().screenWidth - 40.w,
      height: 160.h,
      child: Stack(
        children: [
          Positioned.fill(
            child: Container(
              decoration: BoxDecoration(
                  color: color210215,
                  borderRadius: 20.r.radius,
                  gradient: LinearGradient(
                      begin: const Alignment(0.8, -1),
                      end: const Alignment(-0.8, 0.8),
                      colors: [
                        colorFF007F,
                        colorFF007F,
                        colorFF007F.withAlpha(200),
                        colorFF007F.withAlpha(220),
                        colorFF007F.withAlpha(240),
                        colorFF007F,
                      ])),
            ),
          ),
          Align(
            alignment: Alignment.topCenter,
            child: Padding(
              padding: EdgeInsets.only(top: 20.h),
              child: Text(
                strItIsAMatch.tr.toUpperCase(),
                style: lfTextStyle(
                    sp: 20.sp, fontFamily: fontBoldItalic, color: Colors.white),
              ),
            ),
          ),
          Align(
            alignment: Alignment.bottomCenter,
            child: Padding(
              padding: EdgeInsets.only(bottom: 20.h, right: 60.r),
              child: CustomCacheImage(
                imageUrl: avatar,
                fit: BoxFit.cover,
                width: 80.r,
                height: 80.r,
                isCircle: true,
                boxBorder: Border.all(color: Colors.white, width: 2.r),
              ),
            ),
          ),
          Align(
            alignment: Alignment.bottomCenter,
            child: Padding(
              padding: EdgeInsets.only(bottom: 20.h, left: 60.r),
              child: CustomCacheImage(
                imageUrl: authService.currentAccount?.avatar,
                fit: BoxFit.cover,
                width: 80.r,
                height: 80.r,
                isCircle: true,
                boxBorder: Border.all(color: Colors.white, width: 2.r),
              ),
            ),
          )
        ],
      ),
    );
  }
}
